package com.yupi.usercenter.common;

public class ResultUtils {
    public static <T> BaseResponse<T> success(T data) {

        return new BaseResponse(200, data, "ok");
    }

    //    public static <T> BaseResponse<T> success(T data, String message) {
//
//        return new BaseResponse(200, data, message);
//    }
//
//    public static <T> BaseResponse<T> success(T data, String message,String description) {
//
//        return new BaseResponse(200, data, message);
//    }
//
//    public static <T> BaseResponse<T> success(int code,T data, String message,String description) {
//
//        return new BaseResponse(code, data, message);
//    }
//   public static<T> BaseResponse<T> error(ErrorCode errorCode) {
//        return new BaseResponse<>(errorCode.getCode(), null, errorCode.getMessage());
//    }
    public static <T> BaseResponse<T> error(ErrorCode errorCode, String message) {
        return new BaseResponse<>(errorCode.getCode(), message);
    }

    public static BaseResponse error(String message) {
        return new BaseResponse(50000, message);
    }

    public static BaseResponse error(int code, String message) {
        return new BaseResponse(code, message);
    }


}
